// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 编辑版本信息 PUT /ota/version */
export async function versionManageControllerEdit(
  body: API.UpgradeVersionInfo,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/ota/version`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 保存版本信息 POST /ota/version */
export async function versionManageControllerSave(
  body: API.VersionInfoForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultUpgradeVersionInfo>(`${apiPrefix}/ota/version`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除版本信息 DELETE /ota/version */
export async function versionManageControllerDeleteBatch(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/ota/version`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页获取版本信息 GET /ota/version/list */
export async function versionManageControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.versionManageControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationUpgradeVersionInfo>(`${apiPrefix}/ota/version/list`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 上传软件包 POST /ota/version/upload/${param0} */
export async function versionManageControllerUpload(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.versionManageControllerUploadParams,
  body: {},
  options?: { [key: string]: any },
) {
  const { infoId: param0, ...queryParams } = params;
  return request<API.ApiResultString>(`${apiPrefix}/ota/version/upload/${param0}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}
